<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <a href="https://juejin.im/post/6844903937745616910#heading-7">参考掘金</a>
    <div id="app">
      {{$store.state.name}} <br />
      {{$store.getters.modifyArr}} <br />
      {{$store.getters.getLength}}
      <div v-for="(item,index) in list" :key="index">{{ item }}</div>
      <h3>{{modifyArr}}--{{getLength}}</h3>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.12/vue.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vuex/3.5.1/vuex.js"></script>
    <script src="./store.js"></script>
    <script>
      let vm = new Vue({
        el: "#app",
        data: {},
        store,
        computed: {
          ...Vuex.mapState(["list"]),
          ...Vuex.mapGetters(["modifyArr", "getLength"]),
        },
      });
    </script>
  </body>
</html>
